package org.bulu.project.web.controller;


import org.bulu.project.common.result.Result;
import org.bulu.project.system.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/Category")
public class CategoryController {
    @Autowired
    private CategoryService categoryService;

    @RequestMapping(value = "/getAllCategories")
    public Object getAllCategories() {
        return categoryService.getAllCategories();
    }

    @RequestMapping(value = "/getAllListCategories")
    public Result getAllListCategories() {
        try{
            return categoryService.getAllListCategories();
        }catch (Exception e){
            return Result.failed("false");
        }
    }

}
